﻿Public Class ven_anal_resisfat

    
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        ven_editseccion_fat.Show()

    End Sub

  

    
    Private Sub btn_cargarseccionfat_Click(sender As Object, e As EventArgs) Handles btn_cargarseccionfat.Click
        Dim n As Integer = dgvSecciones.Rows.Add()
        'DataGridView1.Rows.Item(n).Cells(0).Value = "First"
        Dim n2 As Integer = dgvCoeficientes.Rows.Add()

        If esa = 1 And ecvd = 0 And ecvi = 0 And ecdv = 0 Then 'MODELO SIMPLEMENTE APOYADO

            If yc1 > 0 And yc2 = 0 Then 'con una carga
                If y >= 0 And y < yc1 Then
                    mxrf = r1z * y
                    mzrf = r1x * y
                    myrf = 0
                End If
                If y > yc1 And y <= yt Then
                    mxrf = r1z * y + c1z * (y - yc1) - m1x
                    mzrf = r1x * y + c1x * (y - yc1) + m1z
                    myrf = -m1y
                End If
                If y = yc1 Then
                    If sidef = 0 Then
                        mxrf = r1z * y
                        mzrf = r1x * y
                        myrf = 0
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + c1z * (y - yc1) - m1x
                        mzrf = r1x * y + c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                End If
            End If

            If yc1 > 0 And yc2 > 0 Then 'ÁRBOL SIMPLEMENTE APOYADO con dos cargas
                If y >= 0 And y < yc1 Then
                    mxrf = r1z * y
                    mzrf = r1x * y
                    myrf = 0
                End If
                If y > yc1 And y < yc2 Then
                    mxrf = r1z * y + c1z * (y - yc1) - m1x
                    mzrf = r1x * y + c1x * (y - yc1) + m1z
                    myrf = -m1y
                End If
                If y > yc2 And y <= yt Then
                    mxrf = r1z * y + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                    mzrf = r1x * y + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                    myrf = -m1y - m2y
                End If
                If y = yc1 Then
                    If sidef = 0 Then
                        mxrf = r1z * y
                        mzrf = r1x * y
                        myrf = 0
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + c1z * (y - yc1) - m1x
                        mzrf = r1x * y + c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                End If
                If y = yc2 Then
                    If sidef = 0 Then
                        mxrf = r1z * y + c1z * (y - yc1) - m1x
                        mzrf = r1x * y + c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                        mzrf = r1x * y + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                        myrf = -m1y - m2y
                    End If
                End If
            End If

        End If





        If ecvd = 1 And esa = 0 And ecvi = 0 And ecdv = 0 Then 'MODELO CON VOLADIZO DERECHO

            If yc1 > 0 And yc2 = 0 And yc3 > 0 And yc4 = 0 Then 'una carga en cada vano
                If y >= 0 And y < yc1 Then
                    mxrf = r1z * y
                    mzrf = r1x * y
                    myrf = 0
                End If
                If y > yc1 And y < yr2 Then
                    mxrf = r1z * y + c1z * (y - yc1) - m1x
                    mzrf = r1x * y + c1x * (y - yc1) + m1z
                    myrf = -m1y
                End If
                If y > yr2 And y < yc3 Then
                    mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1)) - (m1x)
                    mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1)) + (m1z)
                    myrf = -m1y
                End If
                If y > yc3 And y <= yt Then
                    mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c3z * (y - yc3)) - (m1x + m3x)
                    mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c3x * (y - yc3)) + (m1z + m3z)
                    myrf = -(m1y + m3y)
                End If
                If y = yc1 Then
                    If sidef = 0 Then
                        mxrf = r1z * y
                        mzrf = r1x * y
                        myrf = 0
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + c1z * (y - yc1) - m1x
                        mzrf = r1x * y + c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                End If
                If y = yr2 Then
                    If sidef = 0 Then
                        mxrf = r1z * y + c1z * (y - yc1) - m1x
                        mzrf = r1x * y + c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1)) - (m1x)
                        mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1)) + (m1z)
                        myrf = -m1y
                    End If
                End If
                If y = yc3 Then
                    If sidef = 0 Then
                        mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1)) - (m1x)
                        mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1)) + (m1z)
                        myrf = -m1y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c3z * (y - yc3)) - (m1x + m3x)
                        mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c3x * (y - yc3)) + (m1z + m3z)
                        myrf = -(m1y + m3y)
                    End If
                End If
            End If

            If yc1 > 0 And yc2 > 0 And yc3 > 0 And yc4 = 0 Then 'con dos cargas en primer vano y una carga en segundo vano
                'debemos analizar cuatro puntos del árbol: yc1, yc2, yr2, yc3.
                If y >= 0 And y < yc1 Then
                    mxrf = r1z * y
                    mzrf = r1x * y
                    myrf = 0
                End If
                If y > yc1 And y < yc2 Then
                    mxrf = r1z * y + c1z * (y - yc1) - m1x
                    mzrf = r1x * y + c1x * (y - yc1) + m1z
                    myrf = -m1y
                End If
                If y > yc2 And y < yr2 Then
                    mxrf = r1z * y + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                    mzrf = r1x * y + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                    myrf = -m1y - m2y
                End If
                If y > yr2 And y < yc3 Then
                    mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                    mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                    myrf = -m1y - m2y
                End If
                If y > yc3 And y <= yt Then
                    mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c2z * (y - yc2) + c3z * (y - yc3)) - (m1x + m2x + m3x)
                    mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c2x * (y - yc2) + c3x * (y - yc3)) + (m1z + m2z + m3z)
                    myrf = -(m1y + m2y + m3y)
                End If
                If y = yc1 Then
                    If sidef = 0 Then
                        mxrf = r1z * y
                        mzrf = r1x * y
                        myrf = 0
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + c1z * (y - yc1) - m1x
                        mzrf = r1x * y + c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                End If
                If y = yc2 Then
                    If sidef = 0 Then
                        mxrf = r1z * y + c1z * (y - yc1) - m1x
                        mzrf = r1x * y + c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                        mzrf = r1x * y + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                        myrf = -m1y - m2y
                    End If
                End If
                If y = yr2 Then
                    If sidef = 0 Then
                        mxrf = r1z * y + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                        mzrf = r1x * y + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                        myrf = -m1y - m2y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                        mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                        myrf = -m1y - m2y
                    End If
                End If
                If y = yc3 Then
                    If sidef = 0 Then
                        mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                        mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                        myrf = -m1y - m2y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c2z * (y - yc2) + c3z * (y - yc3)) - (m1x + m2x + m3x)
                        mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c2x * (y - yc2) + c3x * (y - yc3)) + (m1z + m2z + m3z)
                        myrf = -(m1y + m2y + m3y)
                    End If
                End If
            End If


            If yc1 > 0 And yc2 = 0 And yc3 > 0 And yc4 > 0 Then 'con una carga en primer vano y dos cargas en segundo vano
                If y >= 0 And y < yc1 Then
                    mxrf = r1z * y
                    mzrf = r1x * y
                    myrf = 0
                End If
                If y > yc1 And y < yr2 Then
                    mxrf = r1z * y + c1z * (y - yc1) - m1x
                    mzrf = r1x * y + c1x * (y - yc1) + m1z
                    myrf = -m1y
                End If
                If y > yr2 And y < yc3 Then
                    mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1)) - (m1x)
                    mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1)) + (m1z)
                    myrf = -m1y
                End If
                If y > yc3 And y < yc4 Then
                    mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c3z * (y - yc3)) - (m1x + m3x)
                    mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c3x * (y - yc3)) + (m1z + m3z)
                    myrf = -(m1y + m3y)
                End If
                If y > yc4 And y <= yt Then
                    mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c3z * (y - yc3) + c4z * (y - yc4)) - (m1x + m3x + m4x)
                    mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c3x * (y - yc3) + c4x * (y - yc4)) + (m1z + m3z + m4z)
                    myrf = -(m1y + m3y + m4y)
                End If
                If y = yc1 Then
                    If sidef = 0 Then
                        mxrf = r1z * y
                        mzrf = r1x * y
                        myrf = 0
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + c1z * (y - yc1) - m1x
                        mzrf = r1x * y + c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                End If
                If y = yr2 Then
                    If sidef = 0 Then
                        mxrf = r1z * y + c1z * (y - yc1) - m1x
                        mzrf = r1x * y + c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1)) - (m1x)
                        mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1)) + (m1z)
                        myrf = -m1y
                    End If
                End If
                If y = yc3 Then
                    If sidef = 0 Then
                        mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1)) - (m1x)
                        mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1)) + (m1z)
                        myrf = -m1y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c3z * (y - yc3)) - (m1x + m3x)
                        mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c3x * (y - yc3)) + (m1z + m3z)
                        myrf = -(m1y + m3y)
                    End If
                End If
                If y = yc4 Then
                    If sidef = 0 Then
                        mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c3z * (y - yc3)) - (m1x + m3x)
                        mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c3x * (y - yc3)) + (m1z + m3z)
                        myrf = -(m1y + m3y)
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c3z * (y - yc3) + c4z * (y - yc4)) - (m1x + m3x + m4x)
                        mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c3x * (y - yc3) + c4x * (y - yc4)) + (m1z + m3z + m4z)
                        myrf = -(m1y + m3y + m4y)
                    End If
                End If
            End If

            If yc1 > 0 And yc2 > 0 And yc3 > 0 And yc4 > 0 Then 'con dos cargas en cada vano
                If y >= 0 And y < yc1 Then
                    mxrf = r1z * y
                    mzrf = r1x * y
                    myrf = 0
                End If
                If y > yc1 And y < yc2 Then
                    mxrf = r1z * y + c1z * (y - yc1) - m1x
                    mzrf = r1x * y + c1x * (y - yc1) + m1z
                    myrf = -m1y
                End If
                If y > yc2 And y < yr2 Then
                    mxrf = r1z * y + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                    mzrf = r1x * y + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                    myrf = -m1y - m2y
                End If
                If y > yr2 And y < yc3 Then
                    mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                    mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                    myrf = -m1y - m2y
                End If
                If y > yc3 And y < yc4 Then
                    mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c2z * (y - yc2) + c3z * (y - yc3)) - (m1x + m2x + m3x)
                    mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c2x * (y - yc2) + c3x * (y - yc3)) + (m1z + m2z + m3z)
                    myrf = -(m1y + m2y + m3y)
                End If
                If y > yc4 And y <= yt Then
                    mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c2z * (y - yc2) + c3z * (y - yc3) + c4z * (y - yc4)) - (m1x + m2x + m3x + m4x)
                    mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c2x * (y - yc2) + c3x * (y - yc3) + c4x * (y - yc4)) + (m1z + m2z + m3z + m4z)
                    myrf = -(m1y + m2y + m3y + m4y)
                End If
                If y = yc1 Then
                    If sidef = 0 Then
                        mxrf = r1z * y
                        mzrf = r1x * y
                        myrf = 0
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + c1z * (y - yc1) - m1x
                        mzrf = r1x * y + c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                End If
                If y = yc2 Then
                    If sidef = 0 Then
                        mxrf = r1z * y + c1z * (y - yc1) - m1x
                        mzrf = r1x * y + c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                        mzrf = r1x * y + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                        myrf = -m1y - m2y
                    End If
                End If
                If y = yr2 Then
                    If sidef = 0 Then
                        mxrf = r1z * y + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                        mzrf = r1x * y + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                        myrf = -m1y - m2y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                        mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                        myrf = -m1y - m2y
                    End If
                End If
                If y = yc3 Then
                    If sidef = 0 Then
                        mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                        mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                        myrf = -m1y - m2y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c2z * (y - yc2) + c3z * (y - yc3)) - (m1x + m2x + m3x)
                        mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c2x * (y - yc2) + c3x * (y - yc3)) + (m1z + m2z + m3z)
                        myrf = -(m1y + m2y + m3y)
                    End If
                End If
                If y = yc4 Then
                    If sidef = 0 Then
                        mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c2z * (y - yc2) + c3z * (y - yc3)) - (m1x + m2x + m3x)
                        mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c2x * (y - yc2) + c3x * (y - yc3)) + (m1z + m2z + m3z)
                        myrf = -(m1y + m2y + m3y)
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * y + r2z * (y - yr2) + (c1z * (y - yc1) + c2z * (y - yc2) + c3z * (y - yc3) + c4z * (y - yc4)) - (m1x + m2x + m3x + m4x)
                        mzrf = r1x * y + r2x * (y - yr2) + (c1x * (y - yc1) + c2x * (y - yc2) + c3x * (y - yc3) + c4x * (y - yc4)) + (m1z + m2z + m3z + m4z)
                        myrf = -(m1y + m2y + m3y + m4y)
                    End If
                End If
            End If

        End If







        If ecvi = 1 And esa = 0 And ecvd = 0 And ecdv = 0 Then 'MODELO CON VOLADIZO IZQUIERDO !! 16 10 14

            If yc1 > 0 And yc2 = 0 And yc3 > 0 And yc4 = 0 Then 'con una carga en cada vano
                If y >= 0 And y < yc1 Then
                    mxrf = 0
                    mzrf = 0
                    myrf = 0
                End If
                If y > yc1 And y < yr1 Then
                    mxrf = c1z * (y - yc1) - m1x
                    mzrf = c1x * (y - yc1) + m1z
                    myrf = -m1y
                End If
                If y > yr1 And y < yc3 Then
                    mxrf = r1z * (y - yr1) + (c1z * (y - yc1)) - (m1x)
                    mzrf = r1x * (y - yr1) + (c1x * (y - yc1)) + (m1z)
                    myrf = -m1y
                End If
                If y > yc3 And y <= yt Then
                    mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c3z * (y - yc3)) - (m1x + m3x)
                    mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c3x * (y - yc3)) + (m1z + m3z)
                    myrf = -m1y - m3y
                End If
                If y = yc1 Then
                    If sidef = 0 Then
                        mxrf = 0
                        mzrf = 0
                        myrf = 0
                    End If
                    If sidef = 1 Then
                        mxrf = c1z * (y - yc1) - m1x
                        mzrf = c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                End If
                If y = yr1 Then
                    If sidef = 0 Then
                        mxrf = c1z * (y - yc1) - m1x
                        mzrf = c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * (y - yr1) + (c1z * (y - yc1)) - (m1x)
                        mzrf = r1x * (y - yr1) + (c1x * (y - yc1)) + (m1z)
                        myrf = -m1y
                    End If
                End If
                If y = yc3 Then
                    If sidef = 0 Then
                        mxrf = r1z * (y - yr1) + (c1z * (y - yc1)) - (m1x)
                        mzrf = r1x * (y - yr1) + (c1x * (y - yc1)) + (m1z)
                        myrf = -m1y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c3z * (y - yc3)) - (m1x + m3x)
                        mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c3x * (y - yc3)) + (m1z + m3z)
                        myrf = -m1y - m3y
                    End If
                End If
            End If


            If yc1 > 0 And yc2 > 0 And yc3 > 0 And yc4 = 0 Then 'con dos cargas en primer vano y una carga en segundo vano (tres cargas)
                If y >= 0 And y < yc1 Then
                    mxrf = 0
                    mzrf = 0
                    myrf = 0
                End If
                If y > yc1 And y < yc2 Then
                    mxrf = c1z * (y - yc1) - m1x
                    mzrf = c1x * (y - yc1) + m1z
                    myrf = -m1y
                End If
                If y > yc2 And y < yr1 Then
                    mxrf = (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                    mzrf = (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                    myrf = -m1y - m2y
                End If
                If y > yr1 And y < yc3 Then
                    mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                    mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                    myrf = -m1y - m2y
                End If
                If y > yc3 And y <= yt Then
                    mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c2z * (y - yc2) + c3z * (y - yc3)) - (m1x + m2x + m3x)
                    mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c2x * (y - yc2) + c3x * (y - yc3)) + (m1z + m2z + m3z)
                    myrf = -(m1y + m2y + m3y)
                End If
                If y = yc1 Then
                    If sidef = 0 Then
                        mxrf = 0
                        mzrf = 0
                        myrf = 0
                    End If
                    If sidef = 1 Then
                        mxrf = c1z * (y - yc1) - m1x
                        mzrf = c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                End If
                If y = yc2 Then
                    If sidef = 0 Then
                        mxrf = c1z * (y - yc1) - m1x
                        mzrf = c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                    If sidef = 1 Then
                        mxrf = (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                        mzrf = (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                        myrf = -m1y - m2y
                    End If
                End If
                If y = yr1 Then
                    If sidef = 0 Then
                        mxrf = (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                        mzrf = (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                        myrf = -m1y - m2y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                        mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                        myrf = -m1y - m2y
                    End If
                End If
                If y = yc3 Then
                    If sidef = 0 Then
                        mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                        mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                        myrf = -m1y - m2y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c2z * (y - yc2) + c3z * (y - yc3)) - (m1x + m2x + m3x)
                        mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c2x * (y - yc2) + c3x * (y - yc3)) + (m1z + m2z + m3z)
                        myrf = -(m1y + m2y + m3y)
                    End If
                End If
            End If


            If yc1 > 0 And yc2 = 0 And yc3 > 0 And yc4 > 0 Then 'con una carga en primer vano y dos cargas en segundo vano (tres cargas)
                If y >= 0 And y < yc1 Then
                    mxrf = 0
                    mzrf = 0
                    myrf = 0
                End If
                If y > yc1 And y < yr1 Then
                    mxrf = c1z * (y - yc1) - m1x
                    mzrf = c1x * (y - yc1) + m1z
                    myrf = -m1y
                End If
                If y > yr1 And y < yc3 Then
                    mxrf = (c1z * (y - yc1)) - (m1x) + r1z * (y - yr1)
                    mzrf = c1x * (y - yc1) + m1z + r1x * (y - yr1)
                    myrf = -m1y
                End If
                If y > yc3 And y < yc4 Then
                    mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c3z * (y - yc3)) - (m1x + m3x)
                    mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c3x * (y - yc3)) + (m1z + m3z)
                    myrf = -m1y - m3y
                End If
                If y > yc4 And y <= yt Then
                    mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c3z * (y - yc3) + c4z * (y - yc4)) - (m1x + m3x + m4x)
                    mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c3x * (y - yc3) + c4x * (y - yc4)) + (m1z + m3z + m4z)
                    myrf = -(m1y + m3y + m4y)
                End If
                If y = yc1 Then
                    If sidef = 0 Then
                        mxrf = 0
                        mzrf = 0
                        myrf = 0
                    End If
                    If sidef = 1 Then
                        mxrf = c1z * (y - yc1) - m1x
                        mzrf = c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                End If
                If y = yr1 Then
                    If sidef = 0 Then
                        mxrf = c1z * (y - yc1) - m1x
                        mzrf = c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                    If sidef = 1 Then
                        mxrf = (c1z * (y - yc1)) - (m1x) + r1z * (y - yr1)
                        mzrf = c1x * (y - yc1) + m1z + r1x * (y - yr1)
                        myrf = -m1y
                    End If
                End If
                If y = yc3 Then
                    If sidef = 0 Then
                        mxrf = (c1z * (y - yc1)) - (m1x) + r1z * (y - yr1)
                        mzrf = c1x * (y - yc1) + m1z + r1x * (y - yr1)
                        myrf = -m1y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c3z * (y - yc3)) - (m1x + m3x)
                        mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c3x * (y - yc3)) + (m1z + m3z)
                        myrf = -m1y - m3y
                    End If
                End If
                If y = yc4 Then
                    If sidef = 0 Then
                        mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c3z * (y - yc3)) - (m1x + m3x)
                        mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c3x * (y - yc3)) + (m1z + m3z)
                        myrf = -m1y - m3y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c3z * (y - yc3) + c4z * (y - yc4)) - (m1x + m3x + m4x)
                        mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c3x * (y - yc3) + c4x * (y - yc4)) + (m1z + m3z + m4z)
                        myrf = -(m1y + m3y + m4y)
                    End If
                End If
            End If

            If yc1 > 0 And yc2 > 0 And yc3 > 0 And yc4 > 0 Then 'con dos cargas en cada vano
                If y >= 0 And y < yc1 Then
                    mxrf = 0
                    mzrf = 0
                    myrf = 0
                End If
                If y > yc1 And y < yc2 Then
                    mxrf = c1z * (y - yc1) - m1x
                    mzrf = c1x * (y - yc1) + m1z
                    myrf = -m1y
                End If
                If y > yc2 And y < yr1 Then
                    mxrf = (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                    mzrf = (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                    myrf = -m1y - m2y
                End If
                If y > yr1 And y < yc3 Then
                    mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                    mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                    myrf = -m1y - m2y
                End If
                If y > yc3 And y < yc4 Then
                    mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c2z * (y - yc2) + c3z * (y - yc3)) - (m1x + m2x + m3x)
                    mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c2x * (y - yc2) + c3x * (y - yc3)) + (m1z + m2z + m3z)
                    myrf = -(m1y + m2y + m3y)
                End If
                If y > yc4 And y <= yt Then
                    mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c2z * (y - yc2) + c3z * (y - yc3) + c4z * (y - yc4)) - (m1x + m2x + m3x + m4x)
                    mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c2x * (y - yc2) + c3x * (y - yc3) + c4x * (y - yc4)) + (m1z + m2z + m3z + m4z)
                    myrf = -(m1y + m2y + m3y + m4y)
                End If
                If y = yc1 Then
                    If sidef = 0 Then
                        mxrf = 0
                        mzrf = 0
                        myrf = 0
                    End If
                    If sidef = 1 Then
                        mxrf = c1z * (y - yc1) - m1x
                        mzrf = c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                End If
                If y = yc2 Then
                    If sidef = 0 Then
                        mxrf = c1z * (y - yc1) - m1x
                        mzrf = c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                    If sidef = 1 Then
                        mxrf = (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                        mzrf = (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                        myrf = -m1y - m2y
                    End If
                End If
                If y = yr1 Then
                    If sidef = 0 Then
                        mxrf = (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                        mzrf = (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                        myrf = -m1y - m2y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                        mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                        myrf = -m1y - m2y
                    End If
                End If
                If y = yc3 Then
                    If sidef = 0 Then
                        mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c2z * (y - yc2)) - (m1x + m2x)
                        mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c2x * (y - yc2)) + (m1z + m2z)
                        myrf = -m1y - m2y
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c2z * (y - yc2) + c3z * (y - yc3)) - (m1x + m2x + m3x)
                        mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c2x * (y - yc2) + c3x * (y - yc3)) + (m1z + m2z + m3z)
                        myrf = -(m1y + m2y + m3y)
                    End If
                End If
                If y = yc4 Then
                    If sidef = 0 Then
                        mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c2z * (y - yc2) + c3z * (y - yc3)) - (m1x + m2x + m3x)
                        mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c2x * (y - yc2) + c3x * (y - yc3)) + (m1z + m2z + m3z)
                        myrf = -(m1y + m2y + m3y)
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * (y - yr1) + (c1z * (y - yc1) + c2z * (y - yc2) + c3z * (y - yc3) + c4z * (y - yc4)) - (m1x + m2x + m3x + m4x)
                        mzrf = r1x * (y - yr1) + (c1x * (y - yc1) + c2x * (y - yc2) + c3x * (y - yc3) + c4x * (y - yc4)) + (m1z + m2z + m3z + m4z)
                        myrf = -(m1y + m2y + m3y + m4y)
                    End If
                End If
            End If

        End If






        If ecdv = 1 And ecvd = 0 And esa = 0 And ecvi = 0 Then 'MODELO CON DOS VOLADIZOS

            If yc1 > 0 And yc2 = 0 And yc3 > 0 And yc4 = 0 And yc5 > 0 And yc6 = 0 Then 'una carga en cada vano
                If y >= 0 And y < yc1 Then
                    mxrf = 0
                    mzrf = 0
                    myrf = 0
                End If
                If y > yc1 And y < yr1 Then
                    mxrf = c1z * (y - yc1) - m1x
                    mzrf = c1x * (y - yc1) + m1z
                    myrf = -m1y
                End If
                If y > yr1 And y < yc3 Then
                    mxrf = c1z * (y - yc1) + r1z * (y - yr1) - m1x
                    mzrf = c1x * (y - yc1) + r1x * (y - yr1) + m1z
                    myrf = -m1y
                End If
                If y > yc3 And y < yr2 Then
                    mxrf = c1z * (y - yc1) + c3z * (y - yc3) + r1z * (y - yr1) - m1x - m3x
                    mzrf = c1x * (y - yc1) + c3x * (y - yc3) + r1x * (y - yr1) + m1z + m3z
                    myrf = -m1y - m3y
                End If
                If y > yr2 And y < yc5 Then
                    mxrf = c1z * (y - yc1) + c3z * (y - yc3) + r1z * (y - yr1) + r2z * (y - yr2) - m1x - m3x
                    mzrf = c1x * (y - yc1) + c3x * (y - yc3) + r1x * (y - yr1) + r2x * (y - yr2) + m1z + m3z
                    myrf = -m1y - m3y
                End If
                If y > yc5 And y <= yt Then
                    mxrf = c1z * (y - yc1) + c3z * (y - yc3) + c5z * (y - yc5) + r1z * (y - yr1) + r2z * (y - yr2) - m1x - m3x - m5x
                    mzrf = c1x * (y - yc1) + c3x * (y - yc3) + c5x * (y - yc5) + r1x * (y - yr1) + r2x * (y - yr2) + m1z + m3z + m5z
                    myrf = -m1y - m3y - m5y
                End If
                If y = yc1 Then
                    If sidef = 0 Then
                        mxrf = 0
                        mzrf = 0
                        myrf = 0
                    End If
                    If sidef = 1 Then
                        mxrf = c1z * (y - yc1) - m1x
                        mzrf = c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                End If
                If y = yr1 Then
                    If sidef = 0 Then
                        mxrf = c1z * (y - yc1) - m1x
                        mzrf = c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                    If sidef = 1 Then
                        mxrf = c1z * (y - yc1) + r1z * (y - yr1) - m1x
                        mzrf = c1x * (y - yc1) + r1x * (y - yr1) + m1z
                        myrf = -m1y
                    End If
                End If
                If y = yc3 Then
                    If sidef = 0 Then
                        mxrf = c1z * (y - yc1) + r1z * (y - yr1) - m1x
                        mzrf = c1x * (y - yc1) + r1x * (y - yr1) + m1z
                        myrf = -m1y
                    End If
                    If sidef = 1 Then
                        mxrf = c1z * (y - yc1) + c3z * (y - yc3) + r1z * (y - yr1) - m1x - m3x
                        mzrf = c1x * (y - yc1) + c3x * (y - yc3) + r1x * (y - yr1) + m1z + m3z
                        myrf = -m1y - m3y
                    End If
                End If
                If y = yr2 Then
                    If sidef = 0 Then
                        mxrf = c1z * (y - yc1) + c3z * (y - yc3) + r1z * (y - yr1) - m1x - m3x
                        mzrf = c1x * (y - yc1) + c3x * (y - yc3) + r1x * (y - yr1) + m1z + m3z
                        myrf = -m1y - m3y
                    End If
                    If sidef = 1 Then
                        mxrf = c1z * (y - yc1) + c3z * (y - yc3) + r1z * (y - yr1) + r2z * (y - yr2) - m1x - m3x
                        mzrf = c1x * (y - yc1) + c3x * (y - yc3) + r1x * (y - yr1) + r2x * (y - yr2) + m1z + m3z
                        myrf = -m1y - m3y
                    End If
                End If
                If y = yc5 Then
                    If sidef = 0 Then
                        mxrf = c1z * (y - yc1) + c3z * (y - yc3) + r1z * (y - yr1) + r2z * (y - yr2) - m1x - m3x
                        mzrf = c1x * (y - yc1) + c3x * (y - yc3) + r1x * (y - yr1) + r2x * (y - yr2) + m1z + m3z
                        myrf = -m1y - m3y
                    End If
                    If sidef = 1 Then
                        mxrf = c1z * (y - yc1) + c3z * (y - yc3) + c5z * (y - yc5) + r1z * (y - yr1) + r2z * (y - yr2) - m1x - m3x - m5x
                        mzrf = c1x * (y - yc1) + c3x * (y - yc3) + c5x * (y - yc5) + r1x * (y - yr1) + r2x * (y - yr2) + m1z + m3z + m5z
                        myrf = -m1y - m3y - m5y
                    End If
                End If
            End If

            If yc1 > 0 And yc2 = 0 And yc3 > 0 And yc4 = 0 And yc5 = 0 And yc6 = 0 Then 'una carga en primer vano y segundo vano  ... ninguna carga en tercer vano
                If y >= 0 And y < yc1 Then
                    mxrf = 0
                    mzrf = 0
                    myrf = 0
                End If
                If y > yc1 And y < yr1 Then
                    mxrf = c1z * (y - yc1) - m1x
                    mzrf = c1x * (y - yc1) + m1z
                    myrf = -m1y
                End If
                If y > yr1 And y < yc3 Then
                    mxrf = c1z * (y - yc1) + r1z * (y - yr1) - m1x
                    mzrf = c1x * (y - yc1) + r1x * (y - yr1) + m1z
                    myrf = -m1y
                End If
                If y > yc3 And y < yr2 Then
                    mxrf = c1z * (y - yc1) + c3z * (y - yc3) + r1z * (y - yr1) - m1x - m3x
                    mzrf = c1x * (y - yc1) + c3x * (y - yc3) + r1x * (y - yr1) + m1z + m3z
                    myrf = -m1y - m3y
                End If
                If y > yr2 And y <= yt Then
                    mxrf = c1z * (y - yc1) + c3z * (y - yc3) + r1z * (y - yr1) + r2z * (y - yr2) - m1x - m3x
                    mzrf = c1x * (y - yc1) + c3x * (y - yc3) + r1x * (y - yr1) + r2x * (y - yr2) + m1z + m3z
                    myrf = -m1y - m3y
                End If
                If y = yc1 Then
                    If sidef = 0 Then
                        mxrf = 0
                        mzrf = 0
                        myrf = 0
                    End If
                    If sidef = 1 Then
                        mxrf = c1z * (y - yc1) - m1x
                        mzrf = c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                End If
                If y = yr1 Then
                    If sidef = 0 Then
                        mxrf = c1z * (y - yc1) - m1x
                        mzrf = c1x * (y - yc1) + m1z
                        myrf = -m1y
                    End If
                    If sidef = 1 Then
                        mxrf = c1z * (y - yc1) + r1z * (y - yr1) - m1x
                        mzrf = c1x * (y - yc1) + r1x * (y - yr1) + m1z
                        myrf = -m1y
                    End If
                End If
                If y = yc3 Then
                    If sidef = 0 Then
                        mxrf = c1z * (y - yc1) + r1z * (y - yr1) - m1x
                        mzrf = c1x * (y - yc1) + r1x * (y - yr1) + m1z
                        myrf = -m1y
                    End If
                    If sidef = 1 Then
                        mxrf = c1z * (y - yc1) + c3z * (y - yc3) + r1z * (y - yr1) - m1x - m3x
                        mzrf = c1x * (y - yc1) + c3x * (y - yc3) + r1x * (y - yr1) + m1z + m3z
                        myrf = -m1y - m3y
                    End If
                End If
                If y = yr2 Then
                    If sidef = 0 Then
                        mxrf = c1z * (y - yc1) + c3z * (y - yc3) + r1z * (y - yr1) - m1x - m3x
                        mzrf = c1x * (y - yc1) + c3x * (y - yc3) + r1x * (y - yr1) + m1z + m3z
                        myrf = -m1y - m3y
                    End If
                    If sidef = 1 Then
                        mxrf = c1z * (y - yc1) + c3z * (y - yc3) + r1z * (y - yr1) + r2z * (y - yr2) - m1x - m3x
                        mzrf = c1x * (y - yc1) + c3x * (y - yc3) + r1x * (y - yr1) + r2x * (y - yr2) + m1z + m3z
                        myrf = -m1y - m3y
                    End If
                End If
            End If

            If yc1 = 0 And yc2 = 0 And yc3 > 0 And yc4 = 0 And yc5 > 0 And yc6 = 0 Then 'no carga en primer vano, una carga en segundo vano y tercer vano 
                If y >= 0 And y < yr1 Then
                    mxrf = 0
                    mzrf = 0
                    myrf = 0
                End If
                If y > yr1 And y < yc3 Then
                    mxrf = r1z * (y - yr1)
                    mzrf = r1x * (y - yr1)
                    myrf = 0
                End If
                If y > yc3 And y < yr2 Then
                    mxrf = c3z * (y - yc3) + r1z * (y - yr1) - m3x
                    mzrf = c3x * (y - yc3) + r1x * (y - yr1) + m3z
                    myrf = -m3y
                End If
                If y > yr2 And y < yc5 Then
                    mxrf = c3z * (y - yc3) + r1z * (y - yr1) + r2z * (y - yr2) - m3x
                    mzrf = c3x * (y - yc3) + r1x * (y - yr1) + r2x * (y - yr2) + m3z
                    myrf = -m3y
                End If
                If y > yc5 And y <= yt Then
                    mxrf = c3z * (y - yc3) + c5z * (y - yc5) + r1z * (y - yr1) + r2z * (y - yr2) - m3x - m5x
                    mzrf = c3x * (y - yc3) + c5x * (y - yc5) + r1x * (y - yr1) + r2x * (y - yr2) + m3z + m5z
                    myrf = -m1y - m5y
                End If
                If y = yr1 Then
                    If sidef = 0 Then
                        mxrf = 0
                        mzrf = 0
                        myrf = 0
                    End If
                    If sidef = 1 Then
                        mxrf = r1z * (y - yr1)
                        mzrf = r1x * (y - yr1)
                        myrf = 0
                    End If
                End If
                If y = yc3 Then
                    If sidef = 0 Then
                        mxrf = r1z * (y - yr1)
                        mzrf = r1x * (y - yr1)
                        myrf = 0
                    End If
                    If sidef = 1 Then
                        mxrf = c3z * (y - yc3) + r1z * (y - yr1) - m3x
                        mzrf = c3x * (y - yc3) + r1x * (y - yr1) + m3z
                        myrf = -m3y
                    End If
                End If
                If y = yr2 Then
                    If sidef = 0 Then
                        mxrf = c3z * (y - yc3) + r1z * (y - yr1) - m3x
                        mzrf = c3x * (y - yc3) + r1x * (y - yr1) + m3z
                        myrf = -m3y
                    End If
                    If sidef = 1 Then
                        mxrf = c3z * (y - yc3) + r1z * (y - yr1) + r2z * (y - yr2) - m3x
                        mzrf = c3x * (y - yc3) + r1x * (y - yr1) + r2x * (y - yr2) + m3z
                        myrf = -m3y
                    End If
                End If
                If y = yc5 Then
                    If sidef = 0 Then
                        mxrf = c3z * (y - yc3) + r1z * (y - yr1) + r2z * (y - yr2) - m3x
                        mzrf = c3x * (y - yc3) + r1x * (y - yr1) + r2x * (y - yr2) + m3z
                        myrf = -m3y
                    End If
                    If sidef = 1 Then
                        mxrf = c3z * (y - yc3) + c5z * (y - yc5) + r1z * (y - yr1) + r2z * (y - yr2) - m3x - m5x
                        mzrf = c3x * (y - yc3) + c5x * (y - yc5) + r1x * (y - yr1) + r2x * (y - yr2) + m3z + m5z
                        myrf = -m1y - m5y
                    End If
                End If
            End If

        End If





        mfr = Math.Sqrt(mxrf * mxrf + mzrf * mzrf)
        mtr = myrf

        enf = (32 * mfr) / (3.141592 * (d ^ 3))
        ect = (16 * mtr) / (3.141592 * (d ^ 3))

        eeqm = Math.Sqrt(3 * ect * ect)
        eeqa = Math.Sqrt(enf * enf)

        fsfat = ((eeqa * betakflex / samod) + (eeqm / su)) ^ (-1)




        dgvSecciones.Rows.Item(n).Cells(0).Value = y
        dgvSecciones.Rows.Item(n).Cells(1).Value = mxrf
        dgvSecciones.Rows.Item(n).Cells(2).Value = mzrf
        dgvSecciones.Rows.Item(n).Cells(3).Value = myrf
        dgvSecciones.Rows.Item(n).Cells(4).Value = eeqm
        dgvSecciones.Rows.Item(n).Cells(5).Value = eeqa

        dgvCoeficientes.Rows.Item(n2).Cells(0).Value = samod
        dgvCoeficientes.Rows.Item(n2).Cells(1).Value = ka
        dgvCoeficientes.Rows.Item(n2).Cells(2).Value = kb
        dgvCoeficientes.Rows.Item(n2).Cells(3).Value = kc
        dgvCoeficientes.Rows.Item(n2).Cells(4).Value = kd
        dgvCoeficientes.Rows.Item(n2).Cells(5).Value = ke
        dgvCoeficientes.Rows.Item(n2).Cells(6).Value = betakflex
        dgvCoeficientes.Rows.Item(n2).Cells(7).Value = betaktor
        dgvCoeficientes.Rows.Item(n2).Cells(8).Value = fsfat


    End Sub

   
   

   

    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        Me.Close()
    End Sub

    Private Sub izq_fat_Click(sender As Object, e As EventArgs) Handles izq_fat.Click
        sidef = 0
    End Sub

    Private Sub der_fat_Click(sender As Object, e As EventArgs) Handles der_fat.Click
        sidef = 1
    End Sub

    Private Sub btn_helpanalfat_Click(sender As Object, e As EventArgs) Handles btn_helpanalfat.Click
        ven_helpanalfat.Show()
    End Sub
End Class